home *** CD-ROM | disk | FTP | other *** search
- Path: news.ccs.queensu.ca!qlink!3mb42
- From: 3mb42@qlink.queensu.ca (Ben David Moran)
- Newsgroups: comp.lang.c++
- Subject: Using the %c control in SCANF
- Date: 7 Apr 1996 22:35:58 GMT
- Organization: Queen's University, Kingston
- Message-ID: <4k9g0e$eom@knot.queensu.ca>
- NNTP-Posting-Host: qlink.queensu.ca
- X-Newsreader: TIN [version 1.2 PL2]
-
- Can anyone please give me some examples of using the %c control in the
- scanf function.
-
- I keep getting segmentation faults when I use %c in the following line:
-
- scanf ("%s%c", textLine);
-
- the variable "textLine" is declared as
-
- char textLine[MAXBUFFERSIZE];
-
- while MAXBUFFERSIZE is an integer constant that equals 256.
-
- I am attempting to receive input, but not only up to the next non-blank
- character. I want all of what is typed until the return key is hit.
-
- Can anyone help me use the %c control properly? If not, do you know of a
- better way of accomplishing this, perhaps with iostream.h functions instead?
-
- Any help is appreciated, thanks.
-
- M
-
-